import sys
import pickle

global debug

def init(init_debug):
	global debug
	debug=init_debug
	structures()

def get_structure(k,v):
	structure=structures()
	try:
		l=structure[k][v]
	except:
		l=[]
		print "Item has not been defined"
		pass

	return l



def structures():
	structure={}
	if len(sys.argv) < 2 :
		db="structure.pickle"
	else:
		db= sys.argv[1]
	try:		
		structure=pickle.load(open(db, "rb" ))
	except:
		print "DB file sux!"
		sys.exit()
	return structure
